from flask_sqlalchemy import SQLAlchemy
from src.modules.home.api.HomeApi import api as HomeApi
from src.modules.agent.api.AgentApi import api as AgentApi
from src.modules.agent.api.AgenticApi import api as AgenticApi
from src.modules.agent.api.TopicApi import api as TopicApi
from src.modules.modal.api.chat_api import api as chat_api
from src.modules.common.api.common_api import api as common_api
from src.modules.home.api.user_api import api as user_api
from src.modules.rag.api.document_api import api as retrieve_api
from src.modules.rag.api.advance_api import api as advance_api
from src.modules.rag.api.retrieve_api import api as document_api
from src.modules.rag.api.special_api import api as special_api
from src.modules.rag.api.arxiv_api import api as arxiv_api
from src.modules.rag.api.program_api import api as program_api
from src.modules.memory.api.HistoryRecordApi import api as HistoryRecordApi
from src.modules.memory.api.MemoryDetailApi import api as MemoryDetailApi
from src.modules.setting.api.SystemSettingApi import api as SystemSettingApi

db = SQLAlchemy()
def init_db_session(app):
    db.init_app(app)

def register_blueprint_api(app):
    app.register_blueprint(common_api)
    app.register_blueprint(HomeApi)
    app.register_blueprint(user_api)
    app.register_blueprint(chat_api)
    app.register_blueprint(retrieve_api)
    app.register_blueprint(advance_api)
    app.register_blueprint(document_api)
    app.register_blueprint(special_api)
    app.register_blueprint(arxiv_api)
    app.register_blueprint(program_api)
    app.register_blueprint(AgentApi)
    app.register_blueprint(AgenticApi)
    app.register_blueprint(TopicApi)
    app.register_blueprint(HistoryRecordApi)
    app.register_blueprint(MemoryDetailApi)
    app.register_blueprint(SystemSettingApi)
